package com.efast.dmom.aps.bean;

public enum ShiftItemType {

	WORK("上班",1),
	OT("加班",2),
	MEETING("会议",3),
	REST("休息",4),
	DINING("吃饭",5);
	
	private String name;
	private int code;
	
	private ShiftItemType(String name,int code) {
		this.name=name;
		this.code=code;
	}
	
	public static String getName(int code) {
		for(ShiftItemType type:ShiftItemType.values()) {
			if(code == type.getCode()) {
				return type.getName();
			}
		}
		return null;
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	@Override
	public String toString() {
		return this.code+"_"+this.name;
	}
	
}
